import scrapy
from scrapy_community.items import ScrapyCommunityItem
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time


class CommunitySpider(scrapy.Spider):
    name = "community"
    allowed_domains = ["www.xiaohongshu.com"]
    start_urls = ["https://www.xiaohongshu.com/explore"]


    def parse(self, response):
        for i in range(2):  # 模拟滚动3次，可以根据需要调整
            driver = webdriver.Chrome()
            driver.get('https://www.baidu.com')

        pass


        # 在这里处理滚动后加载的内容
        # section=response.xpath("//div[@class='header-container']]")

        # for i in section:
        #     community_img=i.xpath(".//a[@elementtiming='card-exposed']/@style")
        #     title=i.xpath(".//a[@class='title']/span/text()")
        #     author=i.xpath(".//span[@class='name']/text()")
        #     author_img=i.xpath(".//section//a[@class='author']/img/@src")
        #     print(community_img,title,author,author_img)
            # community=ScrapyCommunityItem(community_img)
